// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "SkeletalInstancedProxy.h"
#include "SkelotComponent.h"
#include "SkeletalInstanceManagerActor.generated.h"

class FSkeletalInstancedProxyAbstract;
class UMBInstancedStaticMeshComponent;
class FMBInstancedBatchProxyAbstract;

UCLASS()
class SKELOT_API ASlgSkeletalInstanceActor : public AActor
{
	GENERATED_BODY()

	friend class USkeletalInstancedSubsystem;
public:
	UFUNCTION(BlueprintCallable)
	void SetComponentClass(TSubclassOf<USkelotComponent> InComponentClass);
	USkelotComponent* FindComponent(FSkeletalInstancedProxyAbstract* Proxy);

private:
	void BeginUpdateInstancedData();
	void UpdateInstancedDataEnd();

public:
	UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
	TMap<FSkeletalInstanceKey, USkelotComponent*> ComponentMap;

	UPROPERTY(BlueprintReadOnly, EditDefaultsOnly)
	TSubclassOf<USkelotComponent> ComponentClass = nullptr; 
};
